<?php

namespace \teamug;

class Func {

  /**
   * Convert a string to ucwords, and remove non-alphanumeric chars
   * 
   * @param string $str Eg: "maximum-timeout.3"
   * @return string Eg: "MaximumTimeout3"
   * 
   */
  public static function stringToName($str) {
    
    $words = preg_replace('/[^a-zA-Z0-9]/', ' ', $str);
    $ucWords = ucwords($words);
    $ucName = str_replace(' ','', $ucWords);
    return $ucName;
  }
  
}